package com.moon.vo;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Document(indexName = "estauction", shards = 3, replicas = 2)
@Data
public class EsTAuction implements Serializable {
    @Id
    private Long id;


    @Field(type = FieldType.Long)
    private Long productId;

    @Field(type = FieldType.Double)
    private BigDecimal basePrice;

    @Field(type = FieldType.Double)
    private BigDecimal stepPrice;

    @Field(type = FieldType.Double)
    private BigDecimal topPrice;

    @Field(type = FieldType.Double)
    private BigDecimal securityPrice;

    @Field(type = FieldType.Long)
    private Long buyerId;

    @Field(type = FieldType.Text)
    private String nickname;

    @Field(type = FieldType.Date)
    private Date createTime;

    @Field(type = FieldType.Date)
    private Date updateTime;

    @Field(type = FieldType.Date)
    private Date startTime;

    @Field(type = FieldType.Date)
    private Integer auctionTime;

    @Field(type = FieldType.Integer)
    private Integer status;

    @Field(type = FieldType.Integer)
    private Integer joinCount;


    @Field(type = FieldType.Long)
    private Long pid;

    @Field(type = FieldType.Long)
    private Long sellerId;

    @Field(value = "productName", analyzer = "ik_max_word", searchAnalyzer = "ik_smart", type = FieldType.Text)
    private String productName;

    @Field(value = "productDetail", analyzer = "ik_max_word", searchAnalyzer = "ik_smart", type = FieldType.Text)
    private String productDetail;

    @Field(type = FieldType.Integer)
    private Integer pstatus;

    @Field(type = FieldType.Keyword)
    private String productImg;

}
